//
//  Person.m
//  MRC_Test
//
//  Created by admin on 2019/7/30.
//  Copyright © 2019 猫爷爷的酱醋茶. All rights reserved.
//

#import "Person.h"
#import "Book.h"

@implementation Person


- (void)dealloc
{
 
    [_name release];
    [_book release];
    NSLog(@"该用户已注销。");
    [super dealloc];
}

-(void)ReadBook
{
    [_book SpreadKnowledge];
    NSLog(@"好书啊 好书！");
}

- (instancetype)initWithName:(NSString *)name andAge:(int)age andBook:(Book *)book
{
    if(self = [super init])
    {
        self.name = name;
        self.age = age;
        self.book = book;
    }
    return self;
}

+(instancetype)person
{
    return [[[self alloc]init]autorelease];
}


+(instancetype)personWithName:(NSString *)name andAge:(int)age andBook:(Book *)book
{
    return [[[self alloc]initWithName:name andAge:age andBook:book]autorelease];
}

@end
